<?php
class Medico extends AppModel {

	var $name = 'Medico';
	//var $recursive = 2;
	var $displayField = 'pessoa_id';
	var $validate = array(
		'especialidade' => array('notempty'),
		'pessoa_id' => array(
				'ruleisUnique' => array(
					'rule' => 'isUnique',
					'message' => 'Medico ja cadastrado'),
				'rulenotempty' => array(
					'rule' => 'notempty')
				)
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Pessoa' => array(
			'className' => 'Pessoa',
			'foreignKey' => 'pessoa_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasMany = array(
		'Exame' => array(
			'className' => 'Exame',
			'foreignKey' => 'medico_id',
			'dependent' => false,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'exclusive' => '',
			'finderQuery' => '',
			'counterQuery' => ''
		)
	);

}
?>